; ----------------------------------------------------------------------------
;
; 
; Language:       English
; Platform:       Win9x / NT
; Author:         A.N.Other <myemail@nowhere.com>
;
; Script Function:
;	Template AutoIt script.
;
; ----------------------------------------------------------------------------


; ----------------------------------------------------------------------------
; Set up our defaults
; ----------------------------------------------------------------------------

;AutoItSetOption("MustDeclareVars", 1)
;AutoItSetOption("MouseCoordMode", 0)
;AutoItSetOption("PixelCoordMode", 0)
;AutoItSetOption("RunErrorsFatal", 0)
;AutoItSetOption("TrayIconDebug", 1)
;AutoItSetOption("WinTitleMatchMode", 4)


; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------

sleep(15000)

Send("n")

sleep(3000)

If FileExists("c:\windows\system32\z\step1") Then
	
	RunWait("d:\tools\spilot_set\GetHostname.exe")
	;GetName.exe:	 	get the hostname either from Goldenkey or from Console input.then create a file
	;			"c:\windows\system32\z\hostname".then	put the hostname into the file.
	
	sleep(1000)
	
        RunWait("d:\tools\spilot_set\Hostname-ip.exe")
	;Hostname-ip.exe:	read the hostname from file "c:\windows\system32\z\hostname",then use its own 
	;			role to translate the hostname into the ipaddress,netmask,default getway and the
	;			DNS server.then put every it creates into the file "c:\windows\system32\z\network".
	
	sleep(1000)
	
	RunWait("d:\tools\spilot_set\test_netshell.exe")
	
	sleep(3000)
	
	
	
	;setting NETWORK	
	RunWait("d:\tools\spilot_set\network-set.exe cfgfile")
	
	sleep(1000)
	
	RunWait("d:\tools\spilot_set\CsCdkey-set.exe cfgfile")
	
	sleep(7000)
	
	RunWait("d:\tools\spilot_set\UninstClient.exe")
	
	sleep(1000)
	
	FileDelete("c:\windows\system32\z\step1")
	
	sleep(1000)
	
	FileCopy("d:\tools\spilot_set\step2", "c:\windows\system32\z\step2") 
	
	Run("d:\tools\spilot_set\NvCoolFX2.2.exe")
	
	
ElseIf 	FileExists("c:\windows\system32\z\step2") Then
	
	RunWait("d:\tools\spilot_set\InstClient.exe")
	
	sleep(1000)
	
	Run("d:\tools\spilot_set\InstRG.exe -p yourname")
	
	FileDelete("c:\windows\system32\z\step2")
	
	RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "start-set.exe")
	
Else	
	Exit
EndIf	
	

